import BaseDao from './baseDao'
import * as Models from '../model/index'
import Sequelize from 'sequelize'

const Op = Sequelize.Op
const cao_zuo_fu = { //操作符
    "==": Op["eq"],
    "!=": Op["ne"],
    ">=": Op["gte"],
    ">": Op["gt"],
    "<=": Op["lte"],
    "<": Op["lt"],
    "in": Op["in"],
    "like": Op["like"]

}

class _Dao extends BaseDao {
    constructor() {
        super()
        this.model = Models.categories
    }

    async findOneByNameAndPassword({name, password}) {
        var result = await this.where({
            name
        }).where({password}).select({}, true)
        // var result = await this.model.findAll({where: {name: {[Op["like"]]: '%test%'}}})
        return result
    }
}


export default (() => new _Dao())()
